package two.chapter_1.c1_2;

import edu.princeton.cs.algs4.StdOut;
import edu.princeton.cs.algs4.StdRandom;

public class Rolls {

    /**
     * 模拟掷骰子
     * @param args
     */
    public static void main(String [] args){

        int SIZE=6;
        Counter[] counters=new Counter[SIZE+1];
        for (int i=1;i<SIZE+1;i++){
            counters[i]=new Counter(i+"");
        }
        int N=1000;
        for (int i=0;i<N;i++){
            counters[StdRandom.uniform(1,SIZE+1)].increment();
        }

        for (int i=1;i<SIZE+1;i++){
            StdOut.println(counters[i]);
        }

    }
}
